#include <stdio.h>
#include "XMLParser.h"
#include "OverlapChecker.h"
#include "Constants.h"

int main(char* args){
	
	int parseResult;
	Document doc;
	Document defMandatory;
	Document defOptional;
	vectorList matches;
	initDocument(&defMandatory,255);
	initDocument(&defOptional,255);
	initDocument(&doc,255);
	
	parseResult = parseFile("parserdefmandatory.xml", &defMandatory, NULL, NULL);
	parseResult = parseFile("parserdefoptional.xml", &defOptional, NULL, NULL);
	parseResult = parseFile("figuras.xml", &doc, &defMandatory, &defOptional);

	if (parseResult != OPERATION_FATAL){
		printDocument(&doc);
		matches = checkOverlaps(&doc);
		displayMatches(matches);
	} else {
		printf("Se ha detectado un error fatal, se detiene el parsing.\n");
	}

	return 0;

}